
#include "manager_message_handle.h"
#include "processhub.h"

using namespace ProcessRouter;

void ManagerMessageHandle::didRecevied()
{
    CMessage msg = channel()->recv();
    if (!msg.isNull()) {
        CMessageEvent event(msg, CMessageEvent::FIFOTYPE);
        event.setFromPid(channel()->childPid());
        Rooftop::EventManager::getInstance()->dispachEvent(event);
    }
}

void ManagerMessageHandle::didConnected()
{
}

void ManagerMessageHandle::didError()
{
    int cpid = channel()->childPid();
    ProcessHub::instance()->info()->removeCoreStatus(cpid);

    ChildProceeErrorEvent event(cpid);
    Rooftop::EventManager::getInstance()->dispachEvent(event);
}

